package io.openmessaging;

import com.sun.deploy.util.StringUtils;
import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable;

import java.util.*;

public class test {

    public static void main(String[] args) {
        int[] temperatures=new int[]{73,74,75,71,69,72,76,73};
        LinkedList<Integer> ll=new LinkedList();
        int[] re=new int[temperatures.length];
        for(int i=0;i<temperatures.length;i++){
            if(ll.isEmpty()||temperatures[ll.getFirst()]<temperatures[i]){
                ll.addFirst(i);
            }else{
                int f=ll.getFirst();
                for(int j=i-1;j>=f;i--){
                    re[j]=i-j;
                    ll.removeFirst();
                }
                ll.addFirst(i);
            }
        }

    }
};
